this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
this.actor._delegate = this;
+ this._parent = null;
this._children = [];
this._ornament = Ornament.NONE;
this._ornamentLabel = new St.Label({ style_class: 'popup-menu-ornament' });
this.actor.connect('key-focus-out', Lang.bind(this, this._onKeyFocusOut));
},
+ _getTopMenu: function() {
+ if (this._parent)
+ return this._parent._getTopMenu();
+ else
+ return this;
+ },
+
+ _setParent: function(parent) {
+ this._parent = parent;
+ },
+
_onStyleChanged: function (actor) {
this._spacing = Math.round(actor.get_theme_node().get_length('spacing'));
},
return this;
},
+ _setParent: function(parent) {
+ this._parent = parent;
+ },
+
getSensitive: function() {
return this._sensitive && this.parentSensitive;
},
else
throw TypeError("Invalid argument to PopupMenuBase.addMenuItem()");
- menuItem._parent = this;
+ menuItem._setParent(this);
this.length++;
},
this.menu.connect('open-state-changed', Lang.bind(this, this._subMenuOpenStateChanged));
},
+ _setParent: function(parent) {
+ this.parent(parent);
+ this.menu._setParent(parent);
+ },
+
syncSensitive: function() {
let sensitive = this.parent();
this._triangle.visible = sensitive;